<template>
    <div class="setting">
       <headNav :title="'设置'"></headNav>
       <div class="setList">
           <ul>
               
                    <!-- <li @click="toUrl('#/schoolAccount/index')" v-show="roleCode == 'Parent'">
                        <img class="yuanT" src="@/assets/img/schoolaccount/i1.png" alt="">
                        <span>校园账户</span>
                        <img class="arrYou" src="@/assets/img/a-arrow.png" alt="">
                    </li> -->
               
                
                    <li @click="toUrl('#/personInfo/index')" >
                        <img class="yuanT" src="@/assets/img/setting/grxx.png" alt="">
                        <span>个人信息</span>
                        <img class="arrYou" src="@/assets/img/a-arrow.png" alt="">
                    </li>
                
                 <a >
                    <li @click="toUrl('http://mappv2.xueerqin.net/app/EquipmentInfo/EquipmentInfo.shtml')" v-show="roleCode == 'Parent'">
                        <img class="yuanT" src="@/assets/img/setting/sbxx.png" alt="">
                        <span>设备信息</span>
                        <img class="arrYou" src="@/assets/img/a-arrow.png" alt="">
                    </li>
                 </a>
             
                    <li @click="toUrl('#/settings/setting')" v-show="roleCode == 'Parent'">
                        <img class="yuanT" src="@/assets/img/setting/sz.png" alt="">
                        <span>设置</span>
                        <img class="arrYou" src="@/assets/img/a-arrow.png" alt="">
                    </li>
               
              
                    <!-- <li @click="toUrl('#/settings/setUp')">
                        <img class="yuanT" src="@/assets/img/setting/zhpj.png" alt="">
                        <span>帮助</span>
                        <img class="arrYou" src="@/assets/img/a-arrow.png" alt="">
                    </li> -->
              
              
                    <li @click="toUrl('#/role')" v-show="isMoreRole">
                        <img class="yuanT" src="@/assets/img/setting/changecode.png" alt="">
                        <span>切换身份</span>
                        <img class="arrYou" src="@/assets/img/a-arrow.png" alt="">
                    </li>
               
           </ul>
       </div>
   
       <div class="exit" @click="DropOut()">退出登录</div>
      
       <bottomNav :index="4"></bottomNav>
    </div>
</template>
<script>
import headNav from '@/components/headNav/headNav';
import bottomNav from '@/components/bottomNav/bottomNav';
import {setUp,exit} from "@/api/settingApi"
import cookie from "@/util/cookie"
export default {
    components: {
    headNav,
    bottomNav
  },
  computed:{
      childList(){
          return this.$store.state.user.childList
      },
      roleCode () {
          return this.$store.state.user.roleCode
      },
      isMoreRole () {
          var a = cookie.get('isMoreRole')
          if (a == 'true') {
              return true
          }else {
              return false
          }
          
      }
  },
  data(){
      return {
         setData:[],
         openId:'',
         schoolId:''
        //  isMoreRole:''
      }
  },
   mounted(){
	
	},
  methods:{
      toUrl(url){
          if(url == 'http://mappv2.xueerqin.net/app/Setting/Setting.shtml' && this.childList.length == 0){
              this.$vux.toast.text('您没有设置孩子', 'top')
              return
          }
          location.href = url
      },
        DropOut (){
            this.$store.dispatch('setting/loginOut')
        }
  }
 
 
}
</script>
<style scoped src="@/assets/css/setting.css">

</style>

